package org.jogdiary2011.controller.person;

import org.jogdiary2011.meta.PersonMeta;
import org.jogdiary2011.model.Person;
import org.jogdiary2011.service.PersonService;
import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;
import org.slim3.util.BeanUtil;

public class EditController extends Controller {

    private PersonService service = new PersonService();
    private PersonMeta meta = PersonMeta.get();
    
    @Override
    public Navigation run() throws Exception {
        Person person = service.get(asKey(meta.key), asLong(meta.version));
        BeanUtil.copy(person, request);
        return forward("edit.jsp");
    }
}
